home *** CD-ROM | disk | FTP | other *** search
- // Scene File: ROOMFLY2.PI
- // Author: Rob McGregor
- //
- // Flying through a room among flying spheres and
- // lights using cubic key frame interpolation...
-
- // Define the range of the animation
- start_frame 0
- end_frame 62
- outfile "room2"
-
- directional_light <1, 5, -1>
- light <150, 5, -150>
-
- if (frame == start_frame) {
- include "..\..\..\colors.inc"
- include "..\..\..\texture.inc"
- include "..\..\..\stones.inc"
- include "pedestal.inc"
- include "picframe.inc"
- include "campath.inc"
- include "room.inc"
- include "sphrpath.inc"
- include "spotpath.inc"
- include "..\venus\venus.inc"
- }
-
- // Set up the key frames in an array
- define KF [0, 8, 17, 26, 35, 44, 53, 62]
-
- // Assign the value of "frame" to variable "F"
- define F frame
-
- // Determine what key frame sequence we're in
- if (F <= KF[1])
- define key 0
- if (F > KF[1] && F <= KF[2])
- define key 1
- if (F > KF[2] && F <= KF[3])
- define key 2
- if (F > KF[3] && F <= KF[4])
- define key 3
- if (F > KF[4] && F <= KF[5])
- define key 4
- if (F > KF[5] && F <= KF[6])
- define key 5
- if (F > KF[6])
- define key 6
-
- // Calculate the value of "t" from the
- // current frame and key frame sequence
- define F1 KF[key]
- define F2 KF[key + 1]
- define t (F - F1) / (F2 - F1)
-
- // Calculate the values of all object's location vectors
- define t3 t^3
- define t2 t^2
-
- include "sphrcalc.inc"
-
- // Now move the spheres to their new locations
- // Sphere1
- object {
- sphere <0, 0, 0>, 0.5
- reflective_red
- translate <s1Px, s1Py, s1Pz>
- }
-
- // Sphere2
- object {
- sphere <0, 0, 0>, 0.5
- reflective_blue
- translate <s2Px, s2Py, s2Pz>
- }
-
- // Sphere3
- object {
- sphere <0, 0, 0>, 0.5
- reflective_green
- translate <s3Px, s3Py, s3Pz>
- }
-
- include "camcalc.inc"
-
- // Set up the camera
- viewpoint {
- from <camPx, camPy, camPz>
- at <0, atPy, atPz>
- up <0, 1, 0>
- angle 45
- resolution 320,200
- aspect 1.6
- max_trace_depth 2
- }
-
- include "spotcalc.inc"
-
- define statue
- object {
- object {
- venus
- rotate <-90, 0, 0>
- translate <0, 0, 0>
- rotate <0, 180, 0>
- real_marble {scale <0.2, 0.2, 0.2>}
- scale <0.5, 0.5, 0.5>
- }
- +
- object {
- pedestal
- scale <3,4,3>
- rotate <0, 10, 0>
- translate <0.1, -3.6, 0.25>
- real_marble {scale <0.25, 0.25, 0.25>}
- }
- rotate <0, -45, 0>
- translate <0, 0.5, 0>
- }
-
- // The room, statue and paintings
- object {
- object {
- room2
- }
- +
- object { statue }
- +
- // picture1
- object {
- picture1
- scale <0.125, 0.125, 0.125>
- rotate <0, 90, 0>
- translate <-9.95, 3.5, 0>
- }
- +
- // picture2
- object {
- picture2
- scale <0.125, 0.125, 0.125>
- //rotate <0, 90, 0>
- translate <0, 3.5, 9.95>
- }
- }
-